import { ViewEvent } from "../../Const";
import BaseModule from "../BaseModule";
import UIView from "./UIView";

export default class UIModule extends BaseModule{
    private _view:UIView=null
    init():void{
        console.log('MainModule.init')
        this.message.on(ViewEvent.SHOW_MAIN_VIEW,()=>{
            //console.log(this)
            if(this._view==null){
                this._view=new UIView()
            }
            this.main.addChild(this._view)
        })
        this.message.on(ViewEvent.INC_ENEMY_COUNT,()=>{
            this._view.inc_enemy_count()
        })
    }
}